package com.kwlt.smc.dao;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.kwlt.smc.entity.Keyword;


/**
 *关键字dao类
 * @author wangweiheng
 *
 */
public interface KeywordDao extends JpaRepository<Keyword, Long> {
	
	
	@Query("select b from Keyword b where b.level='1' and b.status!='X'")
	List<Keyword> findGlobalKeyword();
	
	@Query("select b from Keyword b where b.status!='X' order by b.level,b.source,b.operators,b.channelCode,b.userCode ")
	List<Keyword> findAllKeyword();
	@Query("select t from Keyword t where t.status!='X' ")
	Page<Keyword> findKeywordByPage(Pageable pager);
}
